<template>
    <div class="wrap">
        <b-header :login="true">
            <div>
                <router-link to="/bookCity">书城</router-link>
                <router-link to="/bookShelf">书架</router-link>
            </div>
        </b-header>
        <div class="con">
            <div class="hot">
                <b-dl v-for="item in hotList" :key="item.fiction_id"
                    :cover="item.cover"
                    :title="item.title"
                    :fictionId="item.fiction_id"
                ></b-dl>
            </div>
        </div>
    </div>
</template>
<script>
import bHeader from '../components/b-header'
import bDl from '../components/b-dl'
export default {
    components:{
        bHeader,
        bDl
    },
    data(){
        return {
            hotList:[]
        }
    },
    created(){
        this.$http.get('/api/getHome').then((res) => {
            if(res.data.code === 1){
                this.hotList = res.data.data.items[1].data.data;
                console.log(this.hotList);
            }
        })
    }
}
</script>

<style>
    .wrap{
        width:100%;
        height:100%;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    .con{
        width:100%;
        flex:1;
        overflow:scroll;
    }
    .hot{
        width:100%;
        display: flex;
        flex-wrap: wrap;
    }
</style>

